//
// Created by xinhua on 2021/10/22.
//

#include "Material.h"

Material::Material() {
    p_shader = ShaderUtil::getShaderByName(Config::DEFAULT_SHADER);
    useVertexColor = false;
    pointSize = 1.0f;
}

Material::Material(String shaderName, const Color _baseColor) : baseColor(_baseColor){
    this->p_shader = ShaderUtil::getShaderByName(shaderName);
    useVertexColor = false;
    pointSize = 1.0f;
}

Material::Material(Color _baseColor) {
    this->p_shader = ShaderUtil::getShaderByName(Config::DEFAULT_SHADER);
    this->baseColor = _baseColor;
    useVertexColor = false;
    pointSize = 1.0f;
}

Material::~Material() {
    log_info("gc Material!%p", this);
}

void Material::getUI() {
    ImGui::SliderFloat("VertexPointSize", &this->pointSize, 1.0f, 10.0f);
    ImGui::Checkbox("UseVertexColor", &useVertexColor);
    ImGui::ColorEdit4("BaseColor", &this->baseColor.r);
}

